#include<iostream>
#include<algorithm>

using namespace std;

typedef long long ll;

const int N = 1e5+9;

int n,k;
int h[N],w[N];

bool check(int mid){
	int res = 0;
	for(int i=0;i<n;i++){
		res+=(h[i]/mid)*(w[i]/mid);
	}
	return res>=k;
}

int solve(){
	int l = 1,r=N;
	while(l<r){
		int mid = (l+r+1)>>1;
		if(check(mid)){
			l=mid;
		}else{
			r=mid-1;
		}
	}
	return l;
}

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);cout.tie(0);
	
	cin>>n>>k;
	for(int i=0;i<n;i++){
		cin>>h[i]>>w[i];
	}
	
	cout<<solve()<<endl; 
	
	
	return 0;
} 
